<!DOCTYPE html>
<html>
<head>
    <title>设备故障库</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="3">
                    <i-input v-model="q.faultCode" @on-enter="query" placeholder="故障码"></i-input>
                </i-col>
                <i-col span="3">
                    <i-select placeholder="类型" v-model="q.type">
                        <i-option v-for="item in TypeArray" :value="item.value" :key="item.value">{{item.name}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="3">
                    <i-select placeholder="故障大类" v-model="q.devTypeIdB" @on-change="getDevTypeM">
                        <i-option  v-for="typeB in devTypeBList"  :value="typeB.typeCode" :key="typeB.typeCode">{{typeB.typeName}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="3">
                    <i-select placeholder="故障中类" v-model="q.devTypeIdM" @on-change="getDevTypeS">
                        <i-option v-for="typeM in devTypeMList" :value="typeM.typeCode" :key="typeM.typeCode">{{typeM.typeName}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="4">
                    <i-select placeholder="故障小类"  v-model="q.devTypeIdS">
                        <i-option v-for="typeS in devTypeSList" :value="typeS.typeCode" :key="typeS.typeCode">{{typeS.typeName}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("faultbase:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("faultbase:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("faultbase:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="faultBase" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="故障大类" prop="devTypeIdB">
                        <i-select  v-model="faultBase.devTypeIdB" @on-change="getDevTypeM">
                            <i-option  v-for="typeB in devTypeBList"  :value="typeB.typeCode" :key="typeB.typeCode">{{typeB.typeName}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="故障中类" prop="devTypeIdM">
                        <i-select v-model="faultBase.devTypeIdM" @on-change="getDevTypeS">
                            <i-option v-for="typeM in devTypeMList" :value="typeM.typeCode" :key="typeM.typeCode">{{typeM.typeName}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="故障小类" prop="devTypeIdS">
                        <i-select v-model="faultBase.devTypeIdS">
                            <i-option v-for="typeS in devTypeSList" :value="typeS.typeCode" :key="typeS.typeCode">{{typeS.typeName}}
                                </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="故障类型" prop="faultType">
                        <i-input type="text" v-model="faultBase.faultType" icon="md-arrow-dropdown-circle"  @on-click="faultTree" readonly="readonly" placeholder="故障类型"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11" >
                    <Form-item label="类型" prop="type">
                        <i-select placeholder="类型" v-model="faultBase.type">
                            <i-option v-for="item in TypeArray" :value="item.value" :key="item.value">{{item.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="故障描述" prop="faultAppear">
                        <i-input type="textarea" v-model="faultBase.faultAppear" placeholder="故障现象描述"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="故障原因" prop="faultReason">
                        <i-input type="textarea" v-model="faultBase.faultReason" placeholder="故障原因"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="解决办法" prop="solution">
                        <i-input type="textarea" v-model="faultBase.solution" placeholder="解决办法"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="备注" prop="remark">
                        <i-input type="textarea" v-model="faultBase.remark" placeholder="备注"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">
                返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置
                </i-button>
            </Form-item>
        </i-form>
    </Card>
    <!-- 选择故障类型-->
    <div id="faultLayer" style="display: none;padding:10px;">
        <ul id="faultTree" class="ztree"></ul>
    </div>
</div>

<script src="${rc.contextPath}/js/device/faultbase.js?_${date.systemTime}"></script>
</body>
</html>
